<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div id="wsBillOrder-tabel">
    <table id="wsBillGrid"></table>
</div>

<style>
    .datagrid-header-row {
        background-color: #4dded8;
    }
    a:link {color: #6d73ff; text-decoration:none;}/* 未访问：蓝色、无下划线*/

    a:hover {color: red; text-decoration:underline;} /*鼠标移近：红色、下划线*/

</style>
<script>
    $(function () {
        var table=$('#wsBillGrid');
        table.datagrid({
            url:'api/bill/ws',
            method:'get',
            striped: true,
            //fitColumns: true,
            singleSelect: true,
            pagination: true,
            pageSize: 15,
            pageList: [15,25,35,50,70],
            columns: [[
                { field: 'billStatus', title: '订单状态',  align: 'center',
                    formatter:function(value,rowData,index) {
                        return '<a>'+(rowData.billStatus ? "已出库" : "未出库")+'</a>';
                    }

                },
                { field: 'id', title: '单号', align: 'center',
                    formatter:function(value,rowData,index) {
                        if (rowData.ref != null) {
                            return rowData.ref;
                        }
                    }},
                { field: 'bizdt', title: '业务日期', align: 'center' },
                { field: 'customerId', title: '客户',  align: 'center',
                    formatter:function(value,rowData,index) {
                        if (rowData.customerId != null) {
                            return rowData.customerName;
                        }
                    }},
                { field: 'dealAddress', title: '送货地址', align: 'center'},
                { field: 'saleMoney', title: '销售金额',  align: 'center'},
                { field: 'receivingType', title: '收款方式', align: 'center',
                    formatter:function(value,rowData,index) {
                        if (rowData.receivingType != null && rowData.receivingType=="1" ) {
                            return "现金收款";
                        }
                    }},
                { field: 'warehouseId', title: '出库仓库',  align: 'center',
                    formatter:function(value,rowData,index) {
                        if (rowData.warehouseId != null) {
                            return rowData.warehouseName;
                        }
                    }
                },
                { field: 'bizUserId', title: '业务员',  align: 'center',
                    formatter:function(value,rowData,index) {
                        if (rowData.bizUserId != null) {
                            return rowData.bizUserName;
                        }
                    }},
                {
                    field: 'inputUserId', title: '制单人', align: 'center',
                    formatter: function (value, rowData, index) {
                        if (rowData.inputUserId != null) {
                            return rowData.inputUserName;
                        }
                    }
                },
                { field: 'dateCreated', title: '制单时间', align: 'center' },
                { field: 'memo', title: '备注', align: 'center' }
            ]],
            loadFilter: function (data) {
                if(data != null ){
                    return data.data;
                }
            }
        });
    });
</script>